
console.log("13PointSimplifier");
let utils = data["utils"];
let RBushItem = data["RBushItem"];
let RBU = data["RBU"];
let RBush = data["RBush"];
let AreaForRender = data["AreaForRender"];
let quickselect = data["quickselect"];
let SphericalMercator = data["SphericalMercator"];
let PointItem = data["PointItem"];
let PointForRender = data["PointForRender"];
let BoundsItem = data["BoundsItem"];
let QuadTree = data["QuadTree"];
let Node = data["Node"];
let LeftNumFunnel = data["LeftNumFunnel"];

function BaseRender(simpIns, opts) { this._opts = utils.extend({ drawQuadTree: !1, querySupport: !0, mouseEventNames: ["click"], mousemoveDebounceWait: 10, disableHardcoreWhenPointsNumBelow: -1, getAreaSizeForTopSelect: function (zoom, pointSize) { return Math.min(100, pointSize.width * pointSize.height * 1.5) }, getNumForTopSelect: function (zoom, bounds, descendantsNum, pointSize) { var idealNum = bounds.width * bounds.height / (pointSize.width * pointSize.height); return Math.max(3, Math.ceil(1.5 * idealNum)) } }, opts), this._leftNumFunnel = new LeftNumFunnel(["all", "findQuadNodes", "topNAreaSelect", "inMapViewBounds", "hardcoreSpaceCheck"]), this._rTreeForColliDetection = new RBush, this._rTreeForEleIndex = new RBush, this._itemCompare = function (a, b) { return a === b ? 0 : simpIns._compareWithDataIndex(a.idx, b.idx) }, this._ins = simpIns, this._lastMousePos = {}, this._isRendering = !1 } function PointSimplifier(opts) { this._opts = utils.extend({ zIndex: 200, zooms: [3, 20], getPosition: function (dataItem, idx) { throw new Error("getPosition has not been implemented!") }, compareDataItem: function (a, b, aIndex, bIndex) { return aIndex > bIndex ? -1 : 1 }, autoSetFitView: !0, badBoundsAspectRatio: .6, maxChi: 100, maxDepth: 16 }, opts), this.renderEngine = new BaseRender(this, this._opts.renderOptions), this._opts.data && this.setData(this._opts.data) } utils.extend(PointSimplifier.prototype, { _compareWithDataIndex: function (idxA, idxB) { return idxA === idxB ? 0 : this._opts.compareDataItem(this.getDIByInx(idxA), this.getDIByInx(idxB), idxA, idxB) }, getDIByInx: function (idx) { return this._data.source[idx] }, getPixelOfMaxZoom: function (lngLat) { lngLat.getLng && (lngLat = [lngLat.getLng(), lngLat.getLat()]); var maxZoom = this.getMaxZoom(), pMx = SphericalMercator.lngLatToPoint(lngLat, maxZoom); return [Math.round(pMx[0]), Math.round(pMx[1])] }, getTotalPointsNum: function () { return this._data && this._data.list ? this._data.list.length : 0 }, _buildDataItems: function (data) { for (var opts, posGetter = this._opts.getPosition, list = this._data.list, bounds = BoundsItem.getBoundsItemToExpand(), idx = 0, len = data.length; idx < len; idx++) { var point = data[idx], pos = posGetter.call(this, point, idx); if (pos) { var px = this.getPixelOfMaxZoom(pos), item = new PointItem(px[0], px[1], idx, pos[2], point.lng, point.lat, point); list[idx] = item, bounds.expandByPoint(px[0], px[1]) } } this._data.bounds = bounds }, _buildData: function (data) { this._clearData(), this._data.source = data, this._buildDataItems(data), this._buildQuadTree() }, _clearData: function () { this._data ? this._data.list.length = 0 : this._data = { list: [] }, this._data.source = null, this._data.bounds = BoundsItem.getBoundsItemToExpand() } });

return {
  "utils": utils,
  "RBushItem": RBushItem,
  "RBU": RBU,
  "RBush": RBush,
  "AreaForRender": AreaForRender,
  "LeftNumFunnel": LeftNumFunnel,
  "quickselect": quickselect,
  "SphericalMercator": SphericalMercator,
  "PointItem": PointItem,
  "PointForRender": PointForRender,
  "BoundsItem": BoundsItem,
  "QuadTree": QuadTree,
  "Node": Node,
  "PointSimplifier": PointSimplifier,
  "BaseRender": BaseRender
}